<?php
  class Auth extends CI_Controller {
     
     public function index(){          
         $this->load->view('admin/login');
     }
     public function login(){
         $username = $this->input->post('username');
         $password = $this->input->post('password');
         
         $this->load->model('admin/MAuth');
         if ($this->MAuth->login($username,$password)) {
             $arr = array ('username'=>$username,'password'=>$password);
             $this->session->set_userdata($arr);
             redirect('admin/home');
         } else {
             redirect('admin/auth');
         }        
     }
  }
?>
